-- CALC_SKELETON_BONUS

-- 计算骸骨堆奖励
-- @param user  玩家对象
-- @param bonus 配置的奖励
return function(user, bonus)
    local ret = {
        ["status"] = {["status"] = 200, ["prop"] = {506,1,100,3,}, ["end_round"] = 3,}, -- 中毒
    };

    if type(bonus) == 'table' and #bonus > 0 then
        -- 如果配置表中指定了奖励，直接使用
        ret["bonus"] = bonus;
        return ret;
    end

    local arr = {
        { ["class_id"] = 7022, ["ratio"] = 100 }, -- 胫骨
        { ["class_id"] = 7023, ["ratio"] = 100 }, -- 胸骨
        { ["class_id"] = 7024, ["ratio"] = 100 }, -- 颅骨
    };

    local arr2 = {
        { ["count"] = 2, ["ratio"] = 80 },
        { ["count"] = 3, ["ratio"] = 20 },
    };

    -- 获得2~3个某类骨头（概率分别为80%、20%）
    local seed  = DungeonM.getRandSeed("CALC_SKELETON_BONUS");
    local seed2 = DungeonM.getRandSeed("CALC_SKELETON_BONUS");

    local info = fetchElemBySeed(arr, seed);
    local count_info = fetchElemBySeed(arr2, seed2);

    local classId = info["class_id"];
    local count = count_info["count"];
    ret["bonus"] = {
        { 1, classId, count, },
    };

    return ret;
end
